package com.edfu.core.testmgt.vo;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement (name = "Option")
public class Option implements Serializable {

	private static final long serialVersionUID = -7702929206437485151L;
	
	private long id;
	private String opt;
	private boolean answer;
	private FormatType formatType;
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	
	public String getOpt() {
		return opt;
	}
	public void setOpt(String opt) {
		this.opt = opt;
	}
	
	public boolean isAnswer() {
		return answer;
	}
	public void setAnswer(boolean answer) {
		this.answer = answer;
	}
	
	public FormatType getFormatType() {
		return formatType;
	}
	public void setFormatType(FormatType formatType) {
		this.formatType = formatType;
	}
	
	@Override
	public String toString() {
		return "Option [id=" + id + ", opt=" + opt + "]";
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((opt == null) ? 0 : opt.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Option other = (Option) obj;
		if (opt == null) {
			if (other.opt != null)
				return false;
		} else if (!opt.equals(other.opt))
			return false;
		return true;
	}	

}
